package cn.tedu.ivos.vehicle.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class VehicleSaveParam {
    @ApiModelProperty(value = "车辆id")
    private Long id;
    @ApiModelProperty(value = "车辆品牌")
    private String brand;
    @ApiModelProperty(value = "车牌号")
    private String license;
    @ApiModelProperty(value = "车辆型号")
    private String model;
    @ApiModelProperty(value = "车辆识别码")
    private String code;
    @ApiModelProperty(value  ="车辆排量")
    private String displacement;
    @ApiModelProperty(value = "车辆状态")
    private String status;
    @ApiModelProperty(value = "车辆类型")
    private String type;
    @ApiModelProperty(value = "车辆颜色")
    private String color;
    @ApiModelProperty(value = "车辆行驶里程")
    private String kilometers;
//    dto是前端发给后端的数据，所以前端传过来的数据都是string类型
//    前端传过来的日期是2020-1-1是string类型
//    如果想要转换为Data类型，需要使用@DateTimeFormat注解进行转换
//    否则就会出现400 TypeMismatch类型不匹配异常
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "车辆上牌时间")
    private Date regTime;
    @ApiModelProperty(value = "车辆购买时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date buyTime;
    @ApiModelProperty(value = "车辆价格")
    private String price;
    @ApiModelProperty(value = "车辆电池类型")
    private String batteryType;

    @ApiModelProperty(value = "车辆创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    @ApiModelProperty(value = "车辆更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

    @ApiModelProperty(value = "电子围栏绑定状态")
    private String geofenceBindStatus;
    @ApiModelProperty(value = "电子围栏id")
    private Long geofenceId;

}
